{template 'common/header'}
<ul class="nav nav-tabs">
    <li class="active" ><a href="{php echo url('finance/finance/list');}">库款划拨信息列表</a></li>
    <li><a href="{php echo url('finance/finance/add');}">增加库款划拨信息</a></li>
</ul>
<div class="panel panel-info " id="query">
    <div class="panel-heading">
        <a class="accordion-toggle" data-toggle="collapse" href="#collapseOne">
            筛选
        </a>
    </div>
    <div id="collapseOne"  class="panel-body panel-collapse collapse in ">
        <form action="{php echo url('finance/finance/list');}" method="post" class="form-horizontal " role="form">

            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 control-label">发文机关</label>
                <div class="col-sm-2">
                <select name="file" class="form-control">
                    <option value="0">所有发文机关</option>
                    {loop $files $f}
                    <option value="{$f['title']}" {if $_GPC['file'] == $f['title']}selected{/if}>{$f['title']}</option>
                    {/loop}
                </select>
                </div>
                <label class="col-xs-12 col-sm-2 col-md-1 control-label">年份</label>
                <div class="col-sm-2">
                    <input type="text" name="fileyear" class="form-control" value="{$_GPC['fileyear']}" placeholder="请输入年份">
                </div>
                <label class="col-xs-12 col-sm-2 col-md-1 control-label">文号</label>
                <div class="col-sm-2">
                    <input type="text" name="fileid" class="form-control" placeholder="请输入文号">
                </div>
                <div class="pull-right col-xs-12 col-sm-1">
                    <button class="btn btn-block"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
        </form>
    </div>

</div>
<div class="clearfix">
    <div class="table-responsive">
        <table class="table table-hover">
            <thead>
            <tr>
                <th style="width:100px;">发文机关</th>
                <th style="width:70px;">年份</th>
                <th style="width:70px;">文号</th>
                <th style="width:110px;">总拨款金额</th>
                <th style="width:110px;">已拨金额</th>
                <th style="width:110px;">剩余金额</th>
                <th style="width:110px;">拨款次数</th>
                <th style="width: 90px;">创建人</th>
                <th style="width: 100px;">最后拨款日期</th>
                <th style="width:120px;">操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list $row}
            <tr>
                <td>{$row['agency']}</td>
                <td>{$row['fileyear']}</td>
                <td>{$row['fileid']}</td>
                <td>{$row['totalmoney']}</td>
                <td>{$row['money']}</td>
                <td>{php echo ($row['totalmoney']-$row['money']);}</td>
                <td>{$row['num']}</td>
                <td>{$row['creator']}</td>
                <td>{php echo date('Y-m-d H:i:s', $row['createtime'])}</td>
                <td>
                    {php echo geneCtrlBtn($row,$user,'finance');}
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
</div>
{template 'common/footer'}